        /**
         * Handles toggling the navigation menu for small screens.
         */

        $(document).ready(function () {
          
            var button = document.getElementById('top-menu-div').getElementsByTagName('div')[0],
                menu = document.getElementById('top-menu-div').getElementsByTagName('ul')[0];
            
            if (undefined === button)
                return false;

            // Hide button if menu is missing or empty.
            if (undefined === menu || !menu.childNodes.length) {
                button.style.display = 'none';
                return false;
            }

            button.onclick = function () {
                if (-1 == menu.className.indexOf('menuBar'))
                    menu.className = 'menuBar';

                if (-1 != button.className.indexOf('toggledOn')) {
                    button.className = button.className.replace(' toggledOn', '');
                    menu.className = menu.className.replace(' toggledOn', '');
                } else {
                    button.className += ' toggledOn';
                    menu.className += ' toggledOn';
                }
                //$("#top-menu").slideToggle();
            };

        });


